#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main (int argc, char const* argv[])
{
    int n, ccnt, i, len, dict[32];
    char gstr[128];

    dict[0] = 121;
    dict[1] = 104;
    dict[2] = 101;
    dict[3] = 115;
    dict[4] = 111;
    dict[5] = 99;
    dict[6] = 118;
    dict[7] = 120;
    dict[8] = 100;
    dict[9] = 117;
    dict[10] = 105;
    dict[11] = 103;
    dict[12] = 108;
    dict[13] = 98;
    dict[14] = 107;
    dict[15] = 114;
    dict[16] = 122;
    dict[17] = 116;
    dict[18] = 110;
    dict[19] = 119;
    dict[20] = 106;
    dict[21] = 112;
    dict[22] = 102;
    dict[23] = 109;
    dict[24] = 97;
    dict[25] = 113;
    dict[26] = -1;
    dict[27] = -1;
    dict[28] = -1;
    dict[29] = -1;
    dict[30] = -1;
    dict[31] = -1;


    scanf("%d", &n); getchar();
    ccnt = 1;
    while (ccnt <= n) {
        gets(gstr);

        printf("Case #%d: ", ccnt);

        len = strlen(gstr);
        for (i = 0; i < len; i++) {
            if (gstr[i] < 'a' || gstr[i] > 'z') {
                printf("%c", gstr[i]);
            } else {
                printf("%c", dict[gstr[i] - 'a']);
            }
        }
        printf("\n");
        
        ccnt++;
    }

    return 0;
}
